# Maintainer:  Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer:  Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Tom Killian <tomk@runbox.com>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=uptimed
pkgver=0.4.6
pkgrel=3
pkgdesc="A system uptime record daemon"
arch=(loong64 x86_64)
#url="http://podgorny.cz/uptimed/"
url="https://github.com/rpodgorny/uptimed"
license=('GPL')
depends=()
makedepends=('systemd')
backup=(etc/uptimed.conf)
install=$pkgname.install
source=("$pkgname-$pkgver.tar.gz::https://github.com/rpodgorny/uptimed/archive/v$pkgver.tar.gz")
sha512sums=('035caba32182a807312b587b3cb3b6322027b7c8f3e69a3f0b52ea4f44ecfc40505fe58b6a1b56a87a967f1f8b1fbc075414a04b60717577e32972feadb9bc2d')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin
  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  make install DESTDIR="$pkgdir"
  mv "$pkgdir"/etc/uptimed.conf-dist "$pkgdir"/etc/uptimed.conf
}
